#include "Matrix.h"
using namespace std;

int main(int argc, char* argv[])
{
  int arr_a[] = {1,2,3,4,5,6,7,8,9};
  int arr_b[] = {1,2,3,4,5,6};
  int vec[] = {1,2,3};
  int nrow_a = 3;
  int ncol_a = 3;
  int nrow_b = 3;
  int ncol_b = 2;
  int ncol_d = 3;
  int nrow_f = 3;
  Matrix<int> A(nrow_a,ncol_a,arr_a,nrow_a*ncol_a);
  Matrix<int> B(nrow_b,ncol_b,arr_b,nrow_b*ncol_b);
  Matrix<int>C;
  RowVector<int> D(ncol_d,vec);
  int DD;
  RowVector<int> E;
  ColVector<int> F(nrow_f,vec);
  int FF;
  ColVector<int> G;
  Matrix<int>H;
  int I;
  
  B = A;
  C = A*B;
  DD = D*D;
  E = D*A;
  FF = F*F;
  G = F*A;
  H = F*D;
  I = D*F;

  
  cout<<"A(3×3):"<<endl;
  A.show_matrix();
  cout<<"B(3×2):"<<endl;
  B.show_matrix();
  cout<<"A*B = C(正常矩阵乘法):"<<endl;
  C.show_matrix();
  cout<<"D（1×3）:"<<endl;
  D.show_matrix();
  cout<<"D*D（内积1）:"<<endl;
  cout<<setw(5)<<DD<<endl<<endl;
  cout<<"D*A = E:"<<endl;
  E.show_matrix();
  cout<<"F（3×1）:"<<endl;
  F.show_matrix();
  cout<<"F*F:（内积2）"<<endl;
  cout<<setw(5)<<FF<<endl<<endl;
  cout<<"A*F = G:"<<endl;
  G.show_matrix();
  cout<<"F*D = H:"<<endl;
  H.show_matrix();
  cout<<"D*F = I:"<<endl;
  cout<<setw(5)<<I<<endl<<endl;
  return 0;
}



